package org.example;

import javax.swing.*;
import java.awt.*;

public class Panel_1 extends JPanel {

    private JLabel image;

    private JComboBox<String> userName;

    private JLabel password;

    private JComboBox<String> inputUserName;

    private JPasswordField inputPassword;

    private JLabel apply;

    private JLabel forget;

    private JCheckBox autoLogin;

    private JCheckBox cloaking;



    public Panel_1() {
        this.addContent();
    }

    private void addContent() {
        this.setLayout(null);
        this.setBorder(BorderFactory.createLineBorder(new Color(127, 197, 215)));
        //图片标签
        this.image = new JLabel();
        //设置图片自适应大小
        ImageIcon image = new ImageIcon("/Users/cengyunke/Desktop/atm1/QQGUIWork/src/main/java/org/example/img/title.jpg");
        ImageIcon newImage = new ImageIcon(image.getImage().getScaledInstance(320, 50, Image.SCALE_DEFAULT));
        this.image.setIcon(newImage);
        this.image.setBounds(0, 0, 320, 50);
        this.add(this.image);
        /**
         * QQ号码选框
         */
        this.userName = new JComboBox<String>(new String[]{
                "QQ号码"
        });
        this.userName.addItem("电话号码");
        this.userName.setBounds(0, 60, 100, 25);
        this.add(this.userName);
        /**
         * QQ密码文本
         */
        this.password = new JLabel();
        this.password.setText("QQ密码");
        this.password.setBounds(18, 95, 85, 25);
        this.add(this.password);
        /**
         * QQ号码选号
         */
        this.inputUserName = new JComboBox<String>(new String[]{
                "", "1904198060"
        });
        this.inputUserName.setBounds(100, 60, 130, 25);
        this.add(this.inputUserName);
        /**
         * 密码输入框
         */
        this.inputPassword = new JPasswordField();
        this.inputPassword.setBounds(100, 90, 130, 25);
        this.add(this.inputPassword);
        /**
         * 申请号码
         */
        this.apply = new JLabel();
        this.apply.setText("申请号码");
        this.apply.setBounds(235, 58, 60, 25);
        this.add(this.apply);
        /**
         * 忘记密码
         */
        this.forget = new JLabel();
        this.forget.setText("忘记密码");
        this.forget.setBounds(235, 90, 60, 25);
        this.add(this.forget);
        /**
         * 自动登录
         */
        this.autoLogin = new JCheckBox("自动登陆");
        this.autoLogin.setBounds(80, 125, 100, 20);
        this.add(this.autoLogin);
        /**
         * 隐身登录
         */
        this.cloaking = new JCheckBox("隐身登陆");
        this.cloaking.setBounds(175, 125, 100, 20);
        this.add(cloaking);
    }


}
